<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <!-- 内部样式 -->
  <style>
    div{
      width: 200px;height: 200px;
      float: left;
    }
    .c1{background-color: chartreuse; margin-right: 10px;
    }
    .c2{
      background-color:red;margin-left: 20px;
    }
  </style>
</head>
<body>
  <!--  当元素浮动之后,就不会发生外边距的塌陷了,也不会发生合并的现象, 
  上下,左右都会进行相加的
  -->
  <div class="c1">我是div1</div>
  <div class="c2">我是div2</div>
</body>
</html>